using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeUI;
using BankTeller.BankTellerModule;
using Microsoft.Practices.CompositeUI.WinForms;
using BankTeller.BankTellerModule.Constants;
using BankTeller.Infrastructure.Interface;
using BankTeller.BankTellerModule.Services;

namespace BankTeller.CustomerMapExtensionModule
{
    [WorkItemExtension(typeof(ControlledWorkItem<CustomerWorkItemController>))]
    public class CustomerWorkItemExtension : WorkItemExtension
    {
        private CustomerMap mapView;

        protected override void OnActivated()
        {
            if (mapView == null)
            {
                mapView = WorkItem.Items.AddNew<CustomerMap>();
                TabSmartPartInfo info = new TabSmartPartInfo();
                info.Title = "Customer Map";
                info.Description = "Map of the customer location";
                WorkItem.Workspaces[WorkspaceNames.CustomerDetailTabWorkspace].Show(mapView, info);
            }
        }
    }
}
